﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.ships.cruise {
    import Engine.Helpers.*;
    import Classes.*;
    import __AS3__.vec.*;
    import Engine.*;

    public class CruiseShipUtil {

        public static function getAllDockBuildings():Array{
            return (Global.world.getObjectsByNames(["dock_house"]));
        }
        public static function getDockBuilding():MapResource{
            var _local1:Array = getAllDockBuildings();
            return (((_local1.length)==0) ? null : (MathUtil.randomElement(_local1) as MapResource));
        }
        public static function getPiersideDockEntrance(_arg1:MapResource):Vector3{
            return (getEntrance(_arg1, true));
        }
        public static function getRoadsideDockEntrance(_arg1:MapResource):Vector3{
            var _local2:Vector3 = getEntrance(_arg1, false);
            _local2.x = (_local2.x + 1);
            return (_local2);
        }
        protected static function getEntrance(_arg1:MapResource, _arg2:Boolean):Vector3{
            var _local3:Vector.<Vector3> = _arg1.getHotspots();
            if ((((_local3 == null)) || ((_local3.length == 0)))){
                return (null);
            };
            var _local4:int = (_arg2) ? 0 : (_local3.length - 1);
            return (_local3[_local4]);
        }

    }
}//package Modules.ships.cruise 
